package at.markusreich.racecalendar.server;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import at.markusreich.racecalendar.client.model.CalendarEntry;
import at.markusreich.racecalendar.client.service.CalendarService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

@SuppressWarnings("serial")
public class CalendarServiceImpl extends RemoteServiceServlet implements CalendarService {

	@Override
	public List<CalendarEntry> getCalendarEntriesList() throws IllegalArgumentException{
		List<CalendarEntry> calendarEntriesList = new ArrayList<CalendarEntry>();

		CalendarEntry entry = new CalendarEntry();
	    entry.setDate(new Date());
	    entry.setName("Test");
	    calendarEntriesList.add(entry);

	    entry = new CalendarEntry();
	    entry.setDate(new Date());
	    entry.setName("Test 2");
	    calendarEntriesList.add(entry);

		return calendarEntriesList;
	}

	@Override
	public CalendarEntry getCalendarEntry(String id) throws IllegalArgumentException {
		// TODO Auto-generated method stub
		return null;
	}

}
